package com.itheima.controller;

import com.itheima.factory.BeanFactory;
import com.itheima.service.RoleService;
import com.itheima.service.UserService;

public class UserController {
    public static void main(String[] args) throws Exception{
        //耦合:类之间的依赖
       /* UserService userService = BeanFactory.getUserService();
        userService.findAll();
        RoleService beanRole = BeanFactory.getRoleService();
        beanRole.findAll();*/

        UserService userService = (UserService)BeanFactory.getBean("userService");
        userService.findAll();

        RoleService roleService =(RoleService)BeanFactory.getBean("roleService");
        roleService.findAll();
    }
}
